from openpyxl import load_workbook
# 下面的前提是 完成1.新建与保存.py后
wb = load_workbook(r'D:\Desktop\exceltest\my.xlsx')
del wb['my1']
index = wb.index(wb['my2'])
print(f'此时这个excel文件的sheet名字有{wb.sheetnames}')

print(f'此时my2的index为{index}')

# 创建后保存的路径
wb.save(r'D:\Desktop\exceltest\my.xlsx')
